package demo.controller;

import com.stylefeng.guns.core.common.persistence.model.User;
import demo.feign.ToService;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.ws.rs.GET;
import java.util.List;
import java.util.ArrayList;

/**
 * @Author: 朱媛媛
 * @Description：
 * @Date： Created in 下午 3:37 on 2018/3/14 0014.
 */
@RestController
public class testController {

    @Resource
    private ToService toService;

    @RequestMapping("/{id}")
    @GET
    public ResponseEntity hello(@PathVariable int id) {
        User user = new User();
        user.setUserName("测试2");

        User user1 = this.toService.hello();

        List<User> userList = new ArrayList<>();
        userList.add(user);
        userList.add(user1);
        return ResponseEntity.ok(userList);
    }
}
